<?php
require 'connect.php';
$query='select * from products limit 12';
$result=mysql_query($query);
$j=0;
for ($i=0;$i<mysql_num_rows($result);$i++) { 
	$arr[$j++]=mysql_fetch_array($result,MYSQL_ASSOC);
}
echo json_encode($arr);
mysql_close();
?>